﻿<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	
	<title>iStock-Web股票平台</title>
	
	<link rel="stylesheet" href="/site_media/css/stock.css" type="text/css" />
	
	<style type="text/css" title="currentStyle"> 
		@import "/site_media/css/themes/custom-theme/jquery-ui-1.8.9.custom.css";
	</style> 
	
	<script type="text/javascript" src="/site_media/js/jquery-1.5.min.js"></script>
	<script type="text/javascript" src="/site_media/js/jquery.json-2.2.min.js"></script>
	
	<script type="text/javascript" src="/site_media/js/jquery.cookie.js"></script>
	<script type="text/javascript" src="/site_media/js/ui/jquery.ui.core.js"></script>
	<script type="text/javascript" src="/site_media/js/ui/jquery.ui.widget.js"></script>
	<script type="text/javascript" src="/site_media/js/ui/jquery.ui.tabs.js"></script>
	
	<!--[if  lte IE 6 ]>
        <style type="text/css">
        #search{
            margin:12px 0 0 0px;
        }
        

        </style>
    <![endif]-->
	
	<script type="text/javascript">
	   function delind(ev)
	   {
	          ev  =  ev  ||  window.event; // 事件    
              var  target    =  ev.target  ||  ev.srcElement; // 获得事件源
              var id = target.getAttribute("id");
              $("#myuisindice #" + id).remove();
	   }
		
		
		$(document).ready(function(){
					/*$(".viewres").click(function(){
						
						var $scripttext = $("#sscript");
						var stockid = $(this).attr("id");
						
						$.ajax({
							url: "/test4/",
							type: "POST",
							data: "script="+encodeURIComponent($scripttext.val().toString())+"&"+"stockid="+ stockid,
								
							success: function( data ) {
								alert(data);
							},
							error: function(data){
								alert("post data error");
							}
						});
						
					});*/
					
					$("#tabs").tabs({
						cookie: {
							// store cookie for a day, without, it would be a session cookie
							expires: 1
						}
					});

					$(".addindice").click(function(){
						var id = $(this).attr("id");
						alert(id);
						var minv = $("#"+id+"-min").val();
						var maxv = $("#"+id+"-max").val();

						if (minv == ""){
							alert("请输入下限");
							return;
						}
						if (maxv == ""){
							alert("请输入上限");
							return;
						}
						//alert(minv + " " + maxv); 
						var fminv = parseFloat(minv);
						var fmaxv = parseFloat(maxv);
						var name  = $("#"+id+"-name").val();

						if ((fminv + "" == "NaN") || (fmaxv+"" == "NaN")){
							alert("请输入数值");
							return;
						}
						if (fmaxv < fminv){
							alert("上限应该大于等于下限");
							return;
						}
						
						var addind = "<tr id='"+id+"'>";
						
						addind += "<td>"+name+"</td><td>大于</td><td>"+fminv+"</td><td>小于</td><td>"+fmaxv+"</td><td><input id='"+id+"' type='button' value='删除' onclick='delind();' /></td><td><input type='hidden' name='"+id+"'  value='"+fminv+"-"+fmaxv+"'/></td>";
						addind += "</tr>";
						if ($("#myuisindice").find("#"+id).html() != null){
							
							$("#myuisindice #" + id).replaceWith(addind);
						}
						else{
							$("#myuisindice").append(addind);
							
						}
						
					});	
					
					$("#btnscript").click(function(){
					        var script = $("#script").val();
					        $("#iscript").val(script);
					        $("#iscript").show();
					});


		});
		
		
		
	</script>

</head>
<body>
  <div id="content">
	  	{% if uid %}
			<div id="top_info"><a href="/istock/login" >{{uid}}</a> | <a href="/istock/logout/">退出</a></div>	
		{% else %}
			<div id="top_info"><a href="/istock/login" >登录</a></div>	
		{% endif %}
		
		
  		<div id="header">
			<div class="logo">
				<img src="/site_media/images/iStock.png"  alt=""/>
			</div>
			<div id="search"> 
				<form method="post" action="#"> 
					<p><input type="text" name="searchid" class="search" id="stext" /> <input type="submit" value="iStock搜索" class="button" /></p> 
				</form> 
			</div> 
		</div>

		<div id="main">
		    
		    
		    <div id="left">
		            <ul>
		                <li><a href="#">首页</a></li>
		                <li><a href="#">我的首页</a></li>
		                <li><a href="#">我的股票</a></li>
		                <li><a href="#">我的公式</a></li>
		                <li><a href="#">公式计算</a></li>
		                <li><a href="#">公式选股</a></li>
		                <li><a href="#">指标比较</a></li>      
		            </ul>
		    </div>
		    
		    <div id="center" >
			  
			    <div class="myuiheader"></div>
				
				
				<div class="myuiindices">
					<div id="tabs">
						<ul> 
							<li><a href="#tabs-1">财务指标</a></li> 
							<li><a href="#tabs-2">股本结构</a></li> 
							<li><a href="#tabs-3">行情</a></li> 
							<li><a href="#tabs-4">涨跌幅</a></li>
							<li><a href="#tabs-5">自定义</a></li>
						</ul> 
						
						<div id="tabs-1">
						</div>
						<div id="tabs-2">
						</div>
						<div id="tabs-3">
							<table>
								<tr>
									<td>开盘价: ≥</td>
									<td><input id='type-open-min' type="text" /></td>
									<td>元 ≤</td>
									<td><input id='type-open-max' type="text" /></td>
									<td>元</td>
									<td><input id='type-open' class='addindice' type="button" value="添加"/></td>
									<td><input id='type-open-name' type="hidden" value="开盘价"/></td>
								</tr>
							
								<tr>
									<td>最高价: ≥</td>
									<td><input id='type-high-min' type="text" /></td>
									<td>元 ≤</td>
									<td><input id='type-high-max' type="text" /></td>
									<td>元</td>
									<td><input id='type-high' class='addindice' type="button" value="添加"/></td>
									<td><input id='type-high-name' type="hidden" value="最高价"/></td>
								</tr>
							
								<tr>
									<td>最低价: ≥</td>
									<td><input id='type-low-min' type="text" /></td>
									<td>元 ≤</td>
									<td><input id='type-low-max' type="text" /></td>
									<td>元</td>
									<td><input id='type-low' class='addindice' type="button" value="添加"/></td>
									<td><input id='type-low-name' type="hidden" value="最低价"/></td>
								</tr>
							
								<tr>
									<td>收盘价: ≥</td>
									<td><input id='type-close-min' type="text" /></td>
									<td>元 ≤</td>
									<td><input id='type-close-max' type="text" /></td>
									<td>元</td>
									<td><input id='type-close' class='addindice' type="button" value="添加"/></td>
									<td><input id='type-close-name' type="hidden" value="收盘价"/></td>
								</tr>
								
								<tr>
									<td>成交量: ≥</td>
									<td><input id='type-volumn-min' type="text" /></td>
									<td>手 ≤</td>
									<td><input id='type-volumn-max' type="text" /></td>
									<td>手</td>
									<td><input id='type-volumn' class='addindice' type="button" value="添加"/></td>
									<td><input id='type-volumn-name' type="hidden" value="成交量"/></td>
								</tr>
							</table>
							
						</div>
						<div id="tabs-4">
							 <table>
								<tr>
									<td>昨日: ≥</td>
									<td><input id='type-up-min' type="text" /></td>
									<td>% ≤</td>
									<td><input id='type-up-max' type="text" /></td>
									<td>%</td>
									<td><input id='type-up' type="button" value="添加"  class='addindice' /></td>
									<td><input id='type-up-name' type="hidden" value="昨日涨幅%"/></td>
								</tr>
								<tr>
									<td>一周: ≥</td>
									<td><input id='type-wup-min' id='type-wup' type="text" /></td>
									<td>% ≤</td>
									<td><input id='type-wup-max' type="text" /></td>
									<td>%</td>
									<td><input id='type-wup' type="button" value="添加"  class='addindice'/></td>
									<td><input id='type-wup-name' type="hidden" value="周涨幅%"/></td>
								</tr>
								<tr>
									<td>一月: ≥</td>
									<td><input id='type-mup-min' type="text" /></td>
									<td>% ≤</td>
									<td><input id='type-mup-max' type="text" /></td>
									<td>%</td>
									<td><input id='type-mup' type="button" value="添加"  class='addindice'/></td>
									<td><input id='type-mup-name' type="hidden" value="月涨幅%"/></td>
								</tr>
								<tr>
									<td>三月: ≥</td>
									<td><input id='type-3mup-min' type="text" /></td>
									<td>% ≤</td>
									<td><input id='type-3mup-max' type="text" /></td>
									<td>%</td>
									<td><input id='type-3mup' type="button" value="添加"  class='addindice'/></td>
									<td><input id='type-3mup-name' type="hidden" value="三月涨幅%"/></td>
								</tr>
								<tr>
									<td>半年: ≥</td>
									<td><input id='type-6mup-min' type="text" /></td>
									<td>% ≤</td>
									<td><input id='type-6mup-max' type="text" /></td>
									<td>%</td>
									<td><input id='type-6mup' type="button" value="添加"  class='addindice'/></td>
									<td><input id='type-6mup-name' type="hidden" value="半年涨幅%"/></td>
								</tr>
								<tr>
									<td>一年: ≥</td>
									<td><input id='type-yup-min' type="text" /></td>
									<td>% ≤</td>
									<td><input id='type-yup-max' type="text" /></td>
									<td>%</td>
									<td><input id='type-yup' type="button" value="添加"  class='addindice'/></td>
									<td><input id='type-yup-name' type="hidden" value="年涨幅%"/></td>
								</tr>
							</table>
						</div>
						<div id="tabs-5">
							 <div>
									<textarea  style="margin-left:0;" rows="22" cols="35" name="script" id="script"></textarea>
									<input type="button" value="添加" id="btnscript"/>	
							</div>
						</div>
						
					</div>
					
					<div class="myuiselectedindices">
					    <form id='iform' action="/test10/" method="post">
					    	<table id='myuisindice'>
						    </table>		
						    <textarea  id='iscript' name='iscript' readonly="1" value="" rows="20" cols="20" style="display:none;"></textarea>
						    <input type='submit' value="选股"/>
						</form>
					</div>
				</div>
				
            </div>
            
		</div>
		<div id="footer">
			<p>&nbsp;&nbsp;<a href="">关于我们</a> &nbsp;&nbsp; | &nbsp;&nbsp;<a href="">免责声明 </a>&nbsp;&nbsp;| &nbsp;&nbsp;<a href="">联系我们</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="">帮助中心</a>&nbsp;&nbsp;</p>
		</div>
		
  </div>
  
  
</body>
</html>
